package com.tf.temper.entity;

/**
 * 
 *
 * @date 2020-09-15 09:52:39
 */
public class LoginReturnEntity<Entity>
{
	private int code;
	private String message;
	private Entity token;

	public LoginReturnEntity() {
		this.code = 200;
		this.message = "Success";
	}

	public LoginReturnEntity(int code, String message) {
		this.code = code;
		this.message = message;
	}

	public LoginReturnEntity(Entity entity) {
		this();
		this.token = entity;
	}

	public LoginReturnEntity<Entity> ok(Entity entity) {
		this.token = entity;
		return this;
	}

	public LoginReturnEntity<Entity> ok() {
		return this;
	}

	public LoginReturnEntity<Entity> error(String message) {
		return new LoginReturnEntity(500, message);
	}

	public LoginReturnEntity<Entity> errorLogic(String message) {
		return new LoginReturnEntity(404, message);
	}

	public LoginReturnEntity<Entity> put(Entity entity) {
		this.token = entity;
		return this;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Entity getToken() {
		return token;
	}

	public void setToken(Entity token) {
		this.token = token;
	}
}
